/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package estate;

import java.util.ArrayList;

enum UserTypes { normal, admin, worker, agent, company }     //etc.

/**
 *
 * @author gacek
 */


public class User extends Object 
                  implements java.lang.Comparable
{
    private String login;
    private String password;
    private String name;    // imię i nazwisko/nazwa firmy deweloperskiej //proponuje zrobic dwa osobne pola, wtedy moznaby wyswietlic np: Witaj, Bożena (na stronce).
    private String street;
    private String houseNr;
    private String postCode;
    private String city;
    private String mail;
    private String phone;
    private String nip;
    private String regon;
    private String additionalInf;   // informacje dodatkowe
    private UserTypes userType;
    private ArrayList<Estate> kolekcjaEstate;

    public String getLogin(){return login;}
    public void setLogin(String log){login=log;}
    public String getPassword(){return password;}
    public void setPassword(String pass){password=pass;}
    public String getName(){return name;}
    public void setName(String nam){name=nam;}
    public String getStreet(){return street;}
    public void setStreet(String str){street=str;}
    public String getHouseNr(){return houseNr;}
    public void setHouseNr(String house){houseNr=house;}
    public String getPostCode(){return postCode;}
    public void setPostCode(String postC){postCode=postC;}
    public String getCity(){return city;}
    public void setCity(String c){city=c;}
    public String getMail(){return mail;}
    public void setMail(String m){mail=m;}
    public String getPhone(){return phone;}
    public void setPhone(String ph){phone=ph;}
    public String getNIP(){return nip;}
    public void setNIP(String n){ 
        if(this.userType.equals(UserTypes.company))
        {
            nip=null;
        }else{
            nip=n;
        }
    }
    public String getRegon(){return regon;}
    public void setRegon(String r){
        if(this.userType.equals(UserTypes.company))
        {
            regon=r;
        }else{
            regon=null;
        }
    }
    public String getAdditionalInf(){return additionalInf;}
    public void setAdditionalInf(String ad){additionalInf=ad;}
    public UserTypes getUserType(){return userType;}
    public void setUserTypes(UserTypes a){userType=a;}

    /*atrapa compareTo*/
    public int compareTo(Object o)
    {
        return 0;
    }

    /*atrapa equalsa*/
    @Override
    public boolean equals(Object o)
    {
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 37 * hash + (this.login != null ? this.login.hashCode() : 0);
        return hash;
    }
}
